/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Server.persistentie;

import Server.domain.Entity;
import Server.domain.GameLevel;
import Server.domain.Projectile;

/**
 *
 * @author Ripper
 */
public class ProjectileFactory 
{
    private static int id = 0;
    public static Projectile createNewProjectile(GameLevel gl, int ammoType, Entity parent)
    {
        Projectile p = null;
        
        switch(ammoType)
        {
            case 100:
                p = new Projectile(gl, parent, parent.getX(), parent.getY(), 5, parent.getAttackDirection(), 7500, ammoType, id, 500, true);
                break;
                
        }
        
        if(p!=null)
        {
            id++;
            if(id == Integer.MAX_VALUE)
            {
                id = Integer.MIN_VALUE;
            }
        }
        
        return p;
    }
}
